Use pharmpy create_basic_pk_model() as default instead of templates#59
Merged
roninsightrx merged 3 commits intomainfrom Apr 3, 2026
Merged
Use pharmpy create_basic_pk_model() as default instead of templates#59roninsightrx merged 3 commits intomainfrom
roninsightrx merged 3 commits intomainfrom
Conversation
Switch create_model() to use pharmr::create_basic_pk_model() by default (use_template=FALSE) instead of reading from built-in NONMEM template files. This fixes the issue where create_basic_pk_model() returned JSON instead of NONMEM code by converting to NONMEM format early in the pipeline. Key changes: - Add use_template parameter (default FALSE) to create_model() - Convert generic pharmpy model to NONMEM format immediately after creation - Add parameter name mapping (V→VC, V1→VC, V2→VP1, Q→QP1, CL→CLMM) in set_iiv(), set_initial_estimates(), and find_pk_parameter() - Fix blank line handling in create_pharmpy_model_from_list() - Update all affected tests to use new parameter naming conventions - Tests requiring ADVAN-specific features use use_template=TRUE explicitly Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
CI doesn't have devtools installed — tests are loaded automatically by testthat. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
create_model()to usepharmr::create_basic_pk_model()by default (use_template=FALSE) instead of reading from built-in NONMEM template filesV→VC,Q→QP1,V2→VP1) inset_iiv(),set_initial_estimates(), andfind_pk_parameter()create_basic_pk_model()returning JSON instead of NONMEM code by converting to NONMEM format early in the pipelineTest plan
get_pharmpy_confordering failure unrelated to changes)create_model()produces valid NONMEM control streams for iv, oral, and multi-compartment modelsuse_template=TRUEstill works as before for backward compatibility🤖 Generated with Claude Code